package com.rd.p2p.app.common;

import java.io.IOException;
import java.util.Map;

import javax.annotation.Resource;

import org.apache.struts2.convention.annotation.Action;

import com.opensymphony.xwork2.ModelDriven;
import com.qdlc.p2p.biz.model.AppIndexModel;
import com.qdlc.p2p.biz.service.BorrowService;
import com.qdlc.p2p.biz.web.action.BaseAction;
import com.qdlc.p2p.dal.common.model.jpa.PageDataList;
import com.qdlc.p2p.dal.model.BorrowModel;


public class AppIndexAction extends BaseAction<AppIndexModel> implements ModelDriven<AppIndexModel>{
	
	@Resource
	private BorrowService borrowService;
	
	private Map<String,Object> data;
	
	@Action("/app/common/index")
	public void index() throws IOException{ 
		PageDataList<BorrowModel> borrowModelList = borrowService.list(new BorrowModel());	//正在投标列表
		data = model.indexResponse(borrowModelList);
		printWebJson(getStringOfJpaObj(data));
	}
}
